class Borrowing < ActiveRecord::Base
  validates_presence_of :book_id, :user_id, :state, :borrowing_date
  belongs_to :book
  belongs_to :user

  STATE_BORROWED  = 1
  STATE_RETURNED  = 2

  before_create { |me| me.state = STATE_BORROWED }

end

